package cn.cheegon.blog.common.api;


/**
 * @Desc:一些常用API操作码
 * @Author: cheegon
 * @Date: Create in 2024/6/7  下午2:03
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),

    FAILED(5000, "操作失败"),
    REMOTE_ERROR(5100, "远程调用失败"),
    NULL_POINTER_ERROR(5200, "服务器空指针异常"),
    VALIDATE_FAILED(5300, "参数检验失败"),
    IS_NOT_NULL(5310,"%s不能为空"),
    SQL_ERROR(5400, "数据库异常"),
    OTHER_ERROR(6000, "服务器内部错误"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    UNREGIST(601,"未注册"),
    AUTHCODEERR(602,"验证码错误");
    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
